<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>查看设备详情</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('<spring:message code="common.subbmiting"/>');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/equipment/eleEquipment/applylist">设备申请记录</a></li>
		<li class="active">
            <a href="${ctx}/equipment/eleEquipment/form?id=${eleEquipment.id}">设备查看</a>
        </li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="eleEquipment" action="${ctx}/equipment/eleEquipment/formsave" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label"><spring:message code="common.device.id"/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.code}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="common.group.branchoffice"/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.company.name}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="common.group.group"/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.office.name}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code='menu.device.Equipment_Type'/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.type.name}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code='common.resolution'/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.width} X ${eleEquipment.height}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code='common.remarks'/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.remarks}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code='common.applicant'/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.createBy.name}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code='common.approver'/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.checkBy.name}</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">审批状态：</label>
			<div class="controls"><label class="lbl">
				<c:if test="${eleEquipment.delFlag==0}">
					<spring:message code="common.approved"/>
				</c:if>
				<c:if test="${eleEquipment.delFlag==1}">
					失效
				</c:if>
				<c:if test="${eleEquipment.delFlag==2}">
					审批中
				</c:if>
				<c:if test="${eleEquipment.delFlag==3}">
					被驳回
				</c:if>
			</label>
			</div>
		</div>
		<c:if test="${show == 'yes' }">
		<div class="form-actions">
		 <a href="${ctx}/equipment/eleEquipment/form?id=${eleEquipment.id}" class="btn btn-primary">编   辑</a>
                    <a href="${ctx}/equipment/eleEquipment/delete?id=${eleEquipment.id}" onclick="return confirmx('确认要删除该设备吗？', this.href)"
                       class="btn btn-danger">删    除</a>
		   <a href="${ctx}/sys/user/controlerlist?eqId=${eleEquipment.id}" class="btn" type="button" >查看可控用户列表</a>
			<br>
			<br>
			<c:if test="${eleEquipment.delFlag == 2}">
				<shiro:hasPermission name="equipment:eleEquipment:check">
					<a href="${ctx}/equipment/eleEquipment/check?id=${eleEquipment.id}&delFlag=0"
					   onclick="return confirmx('确认要同意添加该设备吗？', this.href)"
					   class="btn btn-success">同 意</a>
					<a href="${ctx}/equipment/eleEquipment/check?id=${eleEquipment.id}&delFlag=3"
					   onclick="return confirmx('确认要驳回该设备添加申请吗？', this.href)"
					   class="btn ">驳 回</a>
				</shiro:hasPermission>
			</c:if>
		</div>
		</c:if>
	</form:form>
</body>
</html>